<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>冷库温湿度历史数据</title>
    <!-- 使用CDN引入CSS -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/datatables/1.10.21/css/jquery.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/datatables.net-buttons-bs4/2.2.3/buttons.bootstrap4.min.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css">
    <style>
        .card {
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
        }
        .card-header {
            background-color: #f8f9fa;
            border-bottom: 1px solid #e9ecef;
            padding: 15px 20px;
            border-top-left-radius: 8px;
            border-top-right-radius: 8px;
        }
        .card-body {
            padding: 20px;
        }
        .form-label {
            font-weight: bold;
        }
        .status-normal {
            color: #28a745;
        }
        .status-warning {
            color: #ffc107;
        }
        .status-danger {
            color: #dc3545;
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <h2 class="mt-4 mb-4">冷库温湿度历史数据</h2>
        
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-search mr-1"></i>查询条件
            </div>
            <div class="card-body">
                <div class="row mb-4">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="warehouseSelect">仓库</label>
                            <select id="warehouseSelect" class="form-control">
                                <option value="">选择仓库</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="storageAreaSelect">冷库区域</label>
                            <select id="storageAreaSelect" class="form-control">
                                <option value="">全部区域</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="deviceIdSelect">设备ID</label>
                            <select id="deviceIdSelect" class="form-control">
                                <option value="">全部设备</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="row mb-4">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="startDateInput">开始时间</label>
                            <input type="text" class="form-control datepicker" id="startDateInput" placeholder="选择开始时间">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="endDateInput">结束时间</label>
                            <input type="text" class="form-control datepicker" id="endDateInput" placeholder="选择结束时间">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>&nbsp;</label>
                            <button type="button" class="btn btn-primary btn-block" id="searchBtn">
                                <i class="fas fa-search"></i> 查询
                            </button>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>&nbsp;</label>
                            <button type="button" class="btn btn-secondary btn-block" id="resetBtn">
                                <i class="fas fa-redo"></i> 重置
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 历史数据表格 -->
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-history mr-1"></i>历史监控数据
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <table id="historyTable" class="table table-bordered" width="100%" cellspacing="0">
                        <thead>
                            <tr>
                                <th>监控ID</th>
                                <th>仓库名称</th>
                                <th>存储区域</th>
                                <th>设备ID</th>
                                <th>温度(°C)</th>
                                <th>湿度(%)</th>
                                <th>状态</th>
                                <th>告警信息</th>
                                <th>记录时间</th>
                                <th>处理状态</th>
                            </tr>
                        </thead>
                        <tbody>
                            <!-- 表格数据将通过JavaScript动态生成 -->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <!-- 使用CDN引入JS -->
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/popper.js/1.16.1/umd/popper.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/datatables/1.10.21/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/datatables.net-buttons/2.2.3/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/datatables.net-buttons/2.2.3/js/buttons.html5.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>
    <script th:src="@{/js/warehouse/coldStorageHistory.js}"></script>
</body>
</html> 